import { Http,Headers } from '@angular/http';
import { Observable } from 'rxjs/RX';
import { Injectable, Inject } from '@angular/core';
import { PublicConfig } from "../config/config";
import 'rxjs/Rx';
import { HttpService } from "../auth/http/http.service";

@Injectable()
export class RegisterService {

    constructor(private http: HttpService, @Inject("pconfig") private pconfig: PublicConfig) {

    }

    // 上传身份证头像
    uploadIdImg(fmdata: any): Observable<Object> {
        let fd:FormData = new FormData();
        fd.append('file', fmdata);
        return this.http.post(this.pconfig.getApiStatus('upLoadFile').url, fd).map(res => { return res.json() });
    }
}